package com.binyuan.move.novelweb;

import cn.novelweb.tool.video.recording.ScreenRecorder;
import org.bytedeco.ffmpeg.global.avutil;

public class ScreenRecorderManager {

    public  static   ScreenRecorder recorder = null;
    /**
     * 获取录屏程序对象
     * @return 录屏程序对象
     */

    public ScreenRecorderManager() {

        recorder =  new ScreenRecorder();
        // 首先你需要构建录屏程序对象,这个是录屏的核心
        // 然后你可以定义一些你需要的参数,直接调用对应的set方法就行
        // 这里不设置任何参数,直接采用默认值...
//        recorder.setSaveTo("D:\\move\\");
//        recorder.setPreset("ultrafast");
//        recorder.setCrf("25");
//        recorder.setVideoQuality(50);
//        recorder.setAudioRecorder(false);
//        recorder.setFrameRate(20);
//        recorder.setVideoBitrate(1000000);

        recorder.setSaveTo("D:\\move\\");
        recorder.setPreset("ultrafast");
        recorder.setCrf("25");
        recorder.setVideoQuality(0);
        recorder.setFrameRate(10);
        recorder.setAudioChannels(0);
        recorder.setVideoBitrate(2000000);
        recorder.setAudioRecorder(false);
        recorder.setPixelFormat(avutil.AV_PIX_FMT_YUV420P); // yuv420p

        // 所有可设置的参数参考 com.dai.RecordingParameters

    }

    public  static ScreenRecorder getScreenRecorder(){
        return recorder;
    }
}
